import request from '@/utils/request'

// 查询资产列表
export function listAsset(query) {
  return request({
    url: '/invest.asset/asset/list',
    method: 'get',
    params: query
  })
}

// 查询资产列表
export function listForRepo(query) {
  return request({
    url: '/invest.asset/asset/listForRepo',
    method: 'get',
    params: query
  })
}

// 查询资产持有人对应股票
export function selectMyStockList(query) {
  return request({
    url: '/invest.asset/asset/selectMyStockList',
    method: 'get',
    params: query
  })
}

// 查询资产详细
export function getAsset(id) {
  return request({
    url: '/invest.asset/asset/' + id,
    method: 'get'
  })
}

// 新增资产
export function addAsset(data) {
  return request({
    url: '/invest.asset/asset',
    method: 'post',
    data: data
  })
}

// 修改资产
export function updateAsset(data) {
  return request({
    url: '/invest.asset/asset',
    method: 'put',
    data: data
  })
}

// 卖出资产
export function sellAsset(data) {
  return request({
    url: '/invest.asset/asset/sell',
    method: 'get',
    params: data
  })
}

// 卖出资产
export function sellForRepo(data) {
  return request({
    url: '/invest.asset/asset/sellForRepo',
    method: 'get',
    params: data
  })
}

// 删除资产
export function delAsset(id) {
  return request({
    url: '/invest.asset/asset/' + id,
    method: 'delete'
  })
}

// 导出资产
export function exportAsset(query) {
  return request({
    url: '/invest.asset/asset/export',
    method: 'get',
    params: query
  })
}
